{extend name="public:_base" /}
{block name="css"}
<link rel="stylesheet" type="text/css" href="__STATIC__/admin/uploadify/uploadify.css">
{/block}
{block name="js"}
{include file="public/_validform"}
<!--上传配置 -->
<script src="__STATIC__/admin/uploadify/jquery.uploadify.min.js" type="text/javascript"></script>
<script src="__STATIC__/admin/js/upfile.js" type="text/javascript"></script>

<!-- 配置文件 -->
<script type="text/javascript" src="__STATIC__/admin/hui/lib/ueditor/1.4.3/ueditor.config.js"></script>
<!-- 编辑器源码文件 -->
<script type="text/javascript" src="__STATIC__/admin/hui/lib/ueditor/1.4.3/ueditor.all.js"></script>

<script type="text/javascript">
    var ue = UE.getEditor('editor');
    $("[name='cid']").find("[value='{$data.cid ?? ''}']").attr("selected", true);
    upload_image('image','','200','200','500');
    var URL = {
        uploader: '{:url('Upload/image')}',
        swf:'__STATIC__/admin/uploadify/uploadify.swf',
        ROOT:'__ROOT__/uploads/image',
        del_url:'{:url('Product/delimage')}',
    }
</script>
{/block}
{block name="main"}
<article class="page-container">
    <form class="form form-horizontal" action="{:url('Article/save')}" id="form" method="post">

        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>文章标题：</label>
            <div class="formControls col-xs-9 col-sm-9">
                <input type="text" class="input-text" value="{$data.title ?? ''}" placeholder="标题"  datatype="*" name="title">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>简略标题：</label>
            <div class="formControls col-xs-9 col-sm-9">
                <input type="text" class="input-text" value="{$data.seo_title ?? ''}" placeholder="简略标题"  datatype="*" name="seo_title">
            </div>
        </div>

        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">排序值：</label>
            <div class="formControls col-xs-9 col-sm-9">
                <input type="number" class="input-text" value="{$data.sort ?? ''}" placeholder="排序值" name="sort">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>关键词：</label>
            <div class="formControls col-xs-9 col-sm-9">
                <input type="text" class="input-text" value="{$data.key ?? ''}" placeholder="关键词"  datatype="*" name="key">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>文章摘要：</label>
            <div class="formControls col-xs-9 col-sm-9">
                <textarea name="miaoshu" cols="" rows="" class="textarea" placeholder="说点什么...最少输入10个字符"
                          datatype="*10-100" dragonfly="true"
                          >{$data.miaoshu ?? ''}</textarea>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">图片：222*157</label>
            <div class="formControls col-xs-9 col-sm-9">
                <div id="image_s"><img src="__ROOT__/uploads/{$data.image ?'image/md_'.$data.image: 'sm_nopic.jpg'}" width="200px" height="200px"/></div>
                <input id="image_post" name="image" type="hidden" value="{$data.image ?? ''}"/>
                <input name="old_image" type="hidden" value="{$data.image ?? ''}"/>
                <input id="image" name="image_upload" type="file" multiple="true">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">文章作者：</label>
            <div class="formControls col-xs-9 col-sm-9">
                <input type="text" class="input-text" value="{$data.issue ?? ''}" placeholder="文章作者"  name="issue">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>文章内容：</label>
            <div class="formControls col-xs-9 col-sm-9">
                <script id="editor" type="text/plain" name="center" style="width:100%;height:400px;">{$data.center|default=''|html_entity_decode ?? ''}</script>
                </div>
        </div>

        <div class="row cl">
            <div class="col-xs-6 col-sm-6 col-xs-offset-4 col-sm-offset-2">
                    <input name="id" value="{$data.id ?? ''}"  type="hidden" />
                    <input type="hidden" value="{$data.cid ?? $addcid}" name="cid" />

                    <input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
                    <button onClick="layer_close();" class="btn btn-default radius" type="button">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
                </div>
        </div>
    </form>
</article>
{/block}